﻿using System;
using System.Web.UI.WebControls;
using C1.Web.Wijmo.Controls.C1GridView;

namespace ControlExplorer.C1GridView
{
    public partial class Scrolling : System.Web.UI.Page
    {
        protected void rblScrollMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (rblScrollMode.SelectedValue)
            {
                case "None":
                    C1GridView1.ScrollMode = ScrollMode.None;
                    break;

                case "Auto":
                    C1GridView1.ScrollMode = ScrollMode.Auto;
                    break;

                case "Horizontal":
                    C1GridView1.ScrollMode = ScrollMode.Horizontal;
                    break;

                case "Vertical":
                    C1GridView1.ScrollMode = ScrollMode.Vertical;
                    break;

                case "Both":
                    C1GridView1.ScrollMode = ScrollMode.Both;
                    break;
            }

            C1GridView1.Width = Unit.Empty;
            C1GridView1.Height = Unit.Empty;

            if (C1GridView1.ScrollMode != ScrollMode.None)
            {
                C1GridView1.Width = new Unit(50, UnitType.Em);
                C1GridView1.Height = new Unit(40, UnitType.Em);
            }

            UpdatePanel1.Update();
        }
    }
}
